type lineItem = {
  xAxis: [];
  name: [];
  value: [];
};
const lineConfig = {
  xAxis: {
    type: "category",
    boundaryGap: false,
    data: []
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [],
      type: "line",
      smooth: true
    }
  ]
};
const generateLineOptions = (data: lineItem[] | number[]) => {
  const xAxis = Array.from(new Set(data.map(item => item.xAxis)));
  lineConfig.xAxis.data = xAxis;
  lineConfig.series[0].data = data;
  return lineConfig;
};
export default generateLineOptions;
